//
//  WorkflowInfo.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 2017/8/23.
//  Copyright © 2017年 com.xtion.crm. All rights reserved.
//

#import "WorkflowInfo.h"

@implementation WorkflowInfo

static XMSQueueDictionary *s_jsonPair;
static XMSQueueDictionary *s_tablePair;

+ (void)initialize
{
    if(s_jsonPair == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"Name" value:@"name"];
        [qd addKey:@"Icon" value:@"icon"];
        [qd addKey:@"MobileType" value:@"mobileType"];
        [qd addKey:@"ClassName" value:@"className"];
        [qd addKey:@"ProcessGUID" value:@"processGUID"];
        [qd addKey:@"ProcessName" value:@"processName"];
        [qd addKey:@"Version" value:@"version"];
        [qd addKey:@"ProcessCode" value:@"processCode"];
        [qd addKey:@"CustomFormID" value:@"customFormID"];
        [qd addKey:@"AllCount" value:@"allCount"];
        [qd addKey:@"ToDoCount" value:@"toDoCount"];
        [qd addKey:@"RowNumber" value:@"rowNumber"];
        
        s_jsonPair = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowInfo class] JSONKeyPair:qd];
    }
    
    if(s_tablePair == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"name" value:@"name"];
        [qd addKey:@"icon" value:@"icon"];
        [qd addKey:@"mobiletype" value:@"mobileType"];
        [qd addKey:@"classname" value:@"className"];
        [qd addKey:@"processguid" value:@"processGUID"];
        [qd addKey:@"processname" value:@"processName"];
        [qd addKey:@"version" value:@"version"];
        [qd addKey:@"processcode" value:@"processCode"];
        [qd addKey:@"customformid" value:@"customFormID"];
        [qd addKey:@"allcount" value:@"allCount"];
        [qd addKey:@"todocount" value:@"toDoCount"];
        [qd addKey:@"rownumber" value:@"rowNumber"];
        
        s_tablePair = [XMSSQLiteDBTable registerTableClass:[WorkflowInfo class] cloumnPropertyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair propertyWithJSONKey:JSONKeys];
}

- (XMSQueueDictionary *)tableClassValue:(NSArray *)arCol
{
    return [XMSSQLiteDBTable tableColumnMap:s_tablePair classObj:self valueWithColoumn:arCol];
}

+ (BOOL)verifyTableName:(NSString*)tableName
{
    return [tableName isEqualToString:@"workflowinfo"];
}

+ (XMSQueueDictionary *)tableColumnProperty:(NSArray *)arCol
{
    return [XMSSQLiteDBTable tableColumnMap:s_tablePair propertyWithColoumn:arCol];
}

- (id)copyWithZone:(NSZone *)zone
{
    WorkflowInfo *ei = [[self class] allocWithZone:zone];
    
    ei.name = [self.name copy];
    ei.icon = [self.icon copy];
    ei.mobileType = [self.mobileType copy];
    ei.className = [self.className copy];
    ei.processGUID = [self.processGUID copy];
    ei.processName = [self.processName copy];
    ei.version = [self.version copy];
    ei.processCode = [self.processCode copy];
    ei.customFormID = [self.customFormID copy];
    ei.allCount = [self.allCount copy];
    ei.toDoCount = [self.toDoCount copy];
    ei.rowNumber = [self.rowNumber copy];
    
    return ei;
}

+(WorkflowInfo*)emptyWorkflowInfo
{
    WorkflowInfo *ei = [WorkflowInfo new];
    ei.name = @"";
    ei.icon = @"";
    ei.mobileType = @"";
    ei.className = @"";
    ei.processGUID = @"";
    ei.processName = @"";
    ei.version = @"";
    ei.processCode = @"";
    ei.customFormID = @"";
    ei.allCount = [XMSNumberInt numberIntWithIntValue:0];
    ei.toDoCount = [XMSNumberInt numberIntWithIntValue:0];
    ei.rowNumber = [XMSNumberInt numberIntWithIntValue:0];

    return ei;
}
@end

@implementation WorkflowAllListInfo

static XMSQueueDictionary *s_jsonPair_workflow_all_list;

+ (void)initialize
{
    if(s_jsonPair_workflow_all_list == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ID" value:@"dataId"];
        [qd addKey:@"Icon" value:@"icon"];
        [qd addKey:@"ProcessGUID" value:@"processGUID"];
        [qd addKey:@"ProcessName" value:@"processName"];
        [qd addKey:@"Version" value:@"version"];
        [qd addKey:@"AppInstanceID" value:@"appInstanceID"];
        [qd addKey:@"AppName" value:@"appName"];
        [qd addKey:@"AppInstanceCode" value:@"appInstanceCode"];
        [qd addKey:@"ProcessState" value:@"processState"];
        [qd addKey:@"ParentProcessInstanceID" value:@"parentProcessInstanceID"];
        [qd addKey:@"ParentProcessGUID" value:@"parentProcessGUID"];
        [qd addKey:@"InvokedActivityInstanceID" value:@"invokedActivityInstanceID"];
        
        [qd addKey:@"CreatedDateTime" value:@"createdDateTime"];
        [qd addKey:@"CreatedByUserID" value:@"createdByUserID"];
        [qd addKey:@"CreatedByUserName" value:@"createdByUserName"];
        
        [qd addKey:@"LastUpdatedDateTime" value:@"lastUpdatedDateTime"];
        [qd addKey:@"LastUpdatedByUserID" value:@"lastUpdatedByUserID"];
        [qd addKey:@"LastUpdatedByUserName" value:@"lastUpdatedByUserName"];
        
        [qd addKey:@"EndedDateTime" value:@"endedDateTime"];
        [qd addKey:@"EndedByUserID" value:@"endedByUserID"];
        [qd addKey:@"EndedByUserName" value:@"endedByUserName"];
        
        [qd addKey:@"RecordStatusInvalid" value:@"recordStatusInvalid"];
        [qd addKey:@"RowVersionID" value:@"rowVersionID"];
        [qd addKey:@"CreatedByDept" value:@"createdByDept"];
        [qd addKey:@"ProcessCode" value:@"processCode"];
        [qd addKey:@"CustomFormID" value:@"customFormID"];
        [qd addKey:@"RowNumber" value:@"rowNumber"];
        
        [qd addKey:@"DateList" value:@"dateList"];
        
        s_jsonPair_workflow_all_list = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowAllListInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_all_list propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowToDoListInfo

static XMSQueueDictionary *s_jsonPair_workflow_todo_list;

+ (void)initialize
{
    if(s_jsonPair_workflow_todo_list == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"CustomFormID" value:@"customFormID"];
        [qd addKey:@"ProcessCode" value:@"processCode"];
        [qd addKey:@"TaskID" value:@"taskID"];
        [qd addKey:@"AppName" value:@"appName"];
        [qd addKey:@"AppInstanceID" value:@"appInstanceID"];
        [qd addKey:@"ProcessGUID" value:@"processGUID"];
        [qd addKey:@"Version" value:@"version"];
        [qd addKey:@"ProcessInstanceID" value:@"processInstanceID"];
        
        [qd addKey:@"ActivityGUID" value:@"AativityGUID"];
        [qd addKey:@"ActivityInstanceID" value:@"activityInstanceID"];
        [qd addKey:@"ActivityName" value:@"activityName"];
        [qd addKey:@"ActivityType" value:@"activityType"];
        
        [qd addKey:@"WorkItemType" value:@"workItemType"];
        [qd addKey:@"PreviousUserID" value:@"previousUserID"];
        [qd addKey:@"PreviousUserName" value:@"previousUserName"];
        [qd addKey:@"PreviousDateTime" value:@"previousDateTime"];
        
        [qd addKey:@"TaskType" value:@"taskType"];
        [qd addKey:@"EntrustedTaskID" value:@"entrustedTaskID"];
        
        [qd addKey:@"AssignedToUserID" value:@"assignedToUserID"];
        [qd addKey:@"AssignedToUserName" value:@"assignedToUserName"];
        [qd addKey:@"CreatedDateTime" value:@"createdDateTime"];
        [qd addKey:@"LastUpdatedDateTime" value:@"lastUpdatedDateTime"];
        
        [qd addKey:@"EndedDateTime" value:@"endedDateTime"];
        [qd addKey:@"EndedByUserID" value:@"endedByUserID"];
        [qd addKey:@"EndedByUserName" value:@"endedByUserName"];
        
        [qd addKey:@"TaskState" value:@"taskState"];
        [qd addKey:@"ActivityState" value:@"activityState"];
        [qd addKey:@"RecordStatusInvalid" value:@"recordStatusInvalid"];
        
        [qd addKey:@"ProcessState" value:@"processState"];
        [qd addKey:@"ComplexType" value:@"complexType"];
        [qd addKey:@"MIHostActivityInstanceID" value:@"mIHostActivityInstanceID"];
        [qd addKey:@"AppInstanceCode" value:@"appInstanceCode"];
        [qd addKey:@"ProcessName" value:@"processName"];
        [qd addKey:@"CreatedByUserName" value:@"createdByUserName"];
        [qd addKey:@"CreatedByUserID" value:@"createdByUserID"];
        [qd addKey:@"PCreatedDateTime" value:@"pCreatedDateTime"];
        [qd addKey:@"MiHostState" value:@"miHostState"];
        
        [qd addKey:@"CreatedByDept" value:@"createdByDept"];
        [qd addKey:@"RowNumber" value:@"rowNumber"];
        
        s_jsonPair_workflow_todo_list = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowToDoListInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_todo_list propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowDateListInfo

static XMSQueueDictionary *s_jsonPair_workflow_date_list;

+ (void)initialize
{
    if(s_jsonPair_workflow_date_list == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"CreatedDateTime" value:@"createdDateTime"];
        [qd addKey:@"ProcessCode" value:@"processCode"];
        [qd addKey:@"RowNumber" value:@"rowNumber"];
        
        s_jsonPair_workflow_date_list = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowDateListInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_date_list propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowApplyInfo

@end

@implementation WorkflowUserInfo

static XMSQueueDictionary *s_jsonPair_workflow_user;

+ (void)initialize
{
    if(s_jsonPair_workflow_user == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"UserID" value:@"userID"];
        [qd addKey:@"UserName" value:@"userName"];
        
        s_jsonPair_workflow_user = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowUserInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_user propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowParticipantInfo

static XMSQueueDictionary *s_jsonPair_workflow_participant;

+ (void)initialize
{
    if(s_jsonPair_workflow_participant == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"Type" value:@"type"];
        [qd addKey:@"ID" value:@"typeId"];
        [qd addKey:@"Name" value:@"name"];
        [qd addKey:@"Code" value:@"code"];
        [qd addKey:@"OuterID" value:@"outerID"];
        
        s_jsonPair_workflow_participant = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowParticipantInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_participant propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowUserEntityInfo

static XMSQueueDictionary *s_jsonPair_workflow_user_entity;

+ (void)initialize
{
    if(s_jsonPair_workflow_user_entity == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ActivityGUID" value:@"activityGUID"];
        [qd addKey:@"ActivityName" value:@"activityName"];
        [qd addKey:@"IsSkipTo" value:@"isSkipTo"];
        [qd addKey:@"ReceiverType" value:@"receiverType"];
        
        s_jsonPair_workflow_user_entity = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowUserEntityInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_user_entity propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowSelectUserInfo
static XMSQueueDictionary *s_jsonPair_workflow_select_user;

+ (void)initialize
{
    if(s_jsonPair_workflow_user == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"Status" value:@"status"];
        [qd addKey:@"Message" value:@"message"];
        
        s_jsonPair_workflow_select_user = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowSelectUserInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_select_user propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowPermissionInfo
static XMSQueueDictionary *s_jsonPair_workflow_permission;

+ (void)initialize
{
    if(s_jsonPair_workflow_permission == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"CurrentActivityName" value:@"currentActivityName"];
        [qd addKey:@"Approve" value:@"approve"];
        [qd addKey:@"WithdrawProcess" value:@"withdrawProcess"];
        [qd addKey:@"SendBackProcess" value:@"sendBackProcess"];
        [qd addKey:@"DiscardProcess" value:@"discardProcess"];
        [qd addKey:@"ReverseProcess" value:@"reverseProcess"];
        [qd addKey:@"SignTogether" value:@"signTogether"];
        
        s_jsonPair_workflow_permission = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowPermissionInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_permission propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowAttachmentInfo
static XMSQueueDictionary *s_jsonPair_workflow_attachment;

+ (void)initialize
{
    if(s_jsonPair_workflow_attachment == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ID" value:@"attachmentId"];
        [qd addKey:@"ModelID" value:@"modelID"];
        [qd addKey:@"SubType" value:@"subType"];
        [qd addKey:@"FielFullName" value:@"fielFullName"];
        [qd addKey:@"FilePreName" value:@"filePreName"];
        [qd addKey:@"FileExtension" value:@"fileExtension"];
        [qd addKey:@"FileSize" value:@"fileSize"];
        [qd addKey:@"FileFolder" value:@"fileFolder"];
        [qd addKey:@"Status" value:@"status"];
        [qd addKey:@"RefferURL" value:@"refferURL"];
        [qd addKey:@"CreateUserId" value:@"createUserId"];
        [qd addKey:@"CreateDate" value:@"createDate"];
        
        s_jsonPair_workflow_attachment = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowAttachmentInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_attachment propertyWithJSONKey:JSONKeys];
}

@end

@implementation WorkflowHistoryInfo
static XMSQueueDictionary *s_jsonPair_workflow_history;

+ (void)initialize
{
    if(s_jsonPair_workflow_history == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ID" value:@"historyId"];
        [qd addKey:@"AppName" value:@"appName"];
        [qd addKey:@"AppInstanceID" value:@"appInstanceID"];
        [qd addKey:@"AppInstanceCode" value:@"appInstanceCode"];
        [qd addKey:@"Status" value:@"status"];
        [qd addKey:@"ActivityName" value:@"activityName"];
        [qd addKey:@"Remark" value:@"remark"];
        [qd addKey:@"ChangedTime" value:@"changedTime"];
        [qd addKey:@"ChangedUserID" value:@"changedUserID"];
        [qd addKey:@"ChangedUserName" value:@"changedUserName"];
        
        s_jsonPair_workflow_history = [CTransformHTTPRESTObj registerJSONObjectClass:[WorkflowHistoryInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_workflow_history propertyWithJSONKey:JSONKeys];
}

@end
